<?php
/*========================================= JooSam =========================================/
/																							/
/	Extention:		JooSam																	/
/	Created by:		Broadcastweb.eu - Paules												/
/	Site:			http://www.broadcastweb.eu												/
/	Email:			support@broadcastweb.eu													/
/	Copyright:		2011 - 2012 (c) Broadcastweb.eu											/
/	License:		CC BY-NC-ND 3.0 ~ http://creativecommons.org/licenses/by-nc-nd/3.0/		/
/	File Version:	0003																	/
/																							/
/========================================== JooSam ========================================*/
// Joomla security
defined('_JEXEC') or die;

// Import Joomla Data
JHtml::_('behavior.tooltip');
$srvActive = $this->srvActive;
$srvOnEdit = $this->srvOnEdit;
$jsmsearch = JRequest::getVar('jsm_lettersearch', 'nolet');
?>
<div class="JSM-Content">
	<form action="<?php echo JRoute::_('index.php?option=com_joosam&view=samsongs'); ?>" method="post" name="adminForm" id="adminForm">
			<div id="spLetterfrm" style="margin-bottom:10px;">
				<span style="padding-right:10px;"><?php echo JText::_('COM_JOOSAM_VIEWS_SAMSONGS_003'); ?></span>
				<button class="spbutton" id="jsm_button_nolet" onclick="spletter('nolet');">#</button>
				<?php foreach(range('A','Z') as $letter): ?>
				<button class="spbutton" id="jsm_button_<?php echo $letter; ?>" onclick="spletter('<?php echo $letter; ?>');"><?php echo $letter; ?></button>
				<?php endforeach; ?>
				<input type="hidden" name="jsm_lettersearch" id="jsm_lettersearch" value="<?php echo $jsmsearch; ?>"/>
			</div>
		<fieldset class="jsm_fieldset">
			<table class="adminlist">
				<thead>
					<tr>
						<th width="35"><?php echo JText::_('COM_JOOSAM_VIEWS_SAMSONGS_004'); ?></th>
						<th width="35"><?php echo JText::_('COM_JOOSAM_VIEWS_SAMSONGS_005'); ?></th>
						<th><?php echo JText::_('COM_JOOSAM_VIEWS_SAMSONGS_006'); ?></th>
						<th><?php echo JText::_('COM_JOOSAM_VIEWS_SAMSONGS_007'); ?></th>
						<th><?php echo JText::_('COM_JOOSAM_VIEWS_SAMSONGS_008'); ?></th>
						<th width="35"></th>
					</tr>
				</thead>
				<tbody>
					<?php if(is_array($this->items) and array_key_exists('0', $this->items)):
						foreach($this->items as $i => $item): ?>
							<tr class="row<?php echo $i % 2; ?>">
						<!--1--><td style="text-align:center; padding:0 0 0 15px;">
									<?php echo JHtml::_('grid.id', $i, $item['ID']); ?>
								</td>
						<!--2--><td class="center">
									<?php echo utf8_encode($item['songtype']); ?>
								</td>
						<!--2--><td class="center">
									<?php echo utf8_encode($item['artist']); ?>
								</td>
						<!--3--><td>
									<?php echo utf8_encode($item['title']); ?>
								</td>
						<!--4--><td>
									<?php echo utf8_encode($item['name']); ?>
								</td>
						<!--5--><td>
									<a href="index.php?option=com_joosam&view=samsong&sid=<?php echo $item['ID']; ?>" title="Edit">
										<img src="/administrator/templates/bluestork/images/admin/featured.png" alt="Edit"/>
									</a>
								</td>
							</tr>
						<?php endforeach;
					else: ?>
						<tr>
							<td class="jsm_nodata" colspan="5" style="text-align:center;"><?php echo JText::_('COM_JOOSAM_VIEWS_SAMSONGS_009'); ?></td>
						</tr><?php
					endif; ?>
				</tbody>
				<tfoot>
					<tr>
						<td colspan="6"><?php
							echo $this->pagination->getListFooter();
							?>
						</td>
					</tr>
				</tfoot>
			</table>
		</fieldset>
		<div>
			<input type="hidden" name="task" value="" />
			<input type="hidden" name="boxchecked" value="0" />
			<?php echo JHtml::_('form.token'); ?>
		</div>
	</form>
</div>
<script>
	function dockload(){
		var source = document.getElementById('jsm_lettersearch').value;
		var target = document.getElementById('jsm_button_'+source);
		target.setAttribute('onclick', 'return false;');
	}
	function spletter(let){
		var target = document.getElementById('jsm_lettersearch').value = let;
		document.adminForm.limitstart.value=0;
		Joomla.submitform();
	}
	document.onLoad = dockload();
</script>
<div class="clr"></div>